package model

// 接口方法 VO
type ApplicationInterfaceMethodVO struct {
	// SystemId 是系统标识
	SystemId string
	// InterfaceId 是接口标识
	InterfaceId string
	// MethodId 是方法标识
	MethodId string
	// MethodName 是方法名称
	MethodName string
	// ParameterType 是参数类型(RPC 限定单参数注册)
	ParameterType string
	// Uri 通过httpUrl匹配的地址
	Uri string
	// HttpCommandType 是接口类型；GET、POST、PUT、DELETE
	HttpCommandType string
	// Auth 是是否鉴权；true = 1是、false = 0否
	Auth int
}

func NewApplicationInterfaceMethodVO(systemId, interfaceId, methodId, methodName, parameterType, uri, httpCommandType string, auth int) ApplicationInterfaceMethodVO {
	return ApplicationInterfaceMethodVO{
		SystemId:        systemId,
		InterfaceId:     interfaceId,
		MethodId:        methodId,
		MethodName:      methodName,
		ParameterType:   parameterType,
		Uri:             uri,
		HttpCommandType: httpCommandType,
		Auth:            auth,
	}
}

// 应用接口 VO
type ApplicationInterfaceVO struct {
	// SystemId 是系统标识
	SystemId string
	// InterfaceId 是接口标识
	InterfaceId string
	// InterfaceName 是接口名称
	InterfaceName string
	// InterfaceVersion 是接口版本
	InterfaceVersion string
	// MethodList 是方法接口列表
	MethodList []ApplicationInterfaceMethodVO
}

func NewApplicationInterfaceVO(systemId, interfaceId, interfaceName, interfaceVersion string) ApplicationInterfaceVO {
	return ApplicationInterfaceVO{
		SystemId:         systemId,
		InterfaceId:      interfaceId,
		InterfaceName:    interfaceName,
		InterfaceVersion: interfaceVersion,
	}
}

// 应用服务 VO
type ApplicationSystemVO struct {
	// SystemId 是系统标识
	SystemId string
	// SystemName 是系统名称
	SystemName string
	// SystemType 是系统类型，比如RPC或HTTP
	SystemType string
	// SystemRegistry 是注册中心的地址nacos://127.0.0.1:8848
	SystemRegistry string
	// InterfaceList 是接口方法列表
	InterfaceList []ApplicationInterfaceVO
}

func NewApplicationSystemVO(systemId, systemName, systemType, systemRegistry string) ApplicationSystemVO {
	return ApplicationSystemVO{
		SystemId:       systemId,
		SystemName:     systemName,
		SystemType:     systemType,
		SystemRegistry: systemRegistry,
	}
}

// 网关算力配置信息
type ApplicationSystemRichInfo struct {
	//网关Id
	GatewayId string
	//系统列表
	ApplicationSystemList []ApplicationSystemVO
}

func NewApplicationSystemRichInfo(gatewayId string, applicationSystemList []ApplicationSystemVO) ApplicationSystemRichInfo {
	return ApplicationSystemRichInfo{
		GatewayId:             gatewayId,
		ApplicationSystemList: applicationSystemList,
	}
}
